from os import write
import requests
import json
url = "https://api.bilibili.com/x/web-interface/card?mid=520657190"
fans_json = requests.get(url).text
# file = "fans.json"
# a = "111"
with open("fans.json",'w',encoding='utf-8') as f:
    f.write(fans_json)